package com.dna.service.impl;

import com.dna.entity.DepartEntity;
import com.dna.entity.ItemSortEntity;
import com.dna.entity.MenuEntity;
import com.dna.entity.UserEntity;
import com.dna.mapper.DepartMapper;
import com.dna.mapper.ItemSortMapper;
import com.dna.service.DepartService;
import com.dna.service.ItemSortService;
import com.dna.utils.Constant.UserState;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Service
public class ItemSortServiceImpl implements ItemSortService {

    @Autowired
    private ItemSortMapper itemSortMapper;

    @Override
    public List<ItemSortEntity> queryAll() {
        List<ItemSortEntity> deptList = itemSortMapper.selectAll();
        
        return deptList;
    }

    @Override
    public ItemSortEntity queryOne(ItemSortEntity dep) {
        return itemSortMapper.selectOne(dep);
    }

    @Override
    @Transactional
    public void save(ItemSortEntity dep) {
        itemSortMapper.insertSelective(dep);

    }

    @Override
    @Transactional
    public void update(ItemSortEntity dep) {
        itemSortMapper.updateByPrimaryKeySelective(dep);
    }

    @Override
    public void delete(ItemSortEntity itemSort, Example example) {
        itemSortMapper.updateByExampleSelective(itemSort, example);
    }


}
